import Vue from 'vue'
import Router from 'vue-router'
import Login from "../views/Login";
import Home from "../views/Home";
import UserInfo from "../views/UserInfo";
import UserInfo1 from "../views/UserInfo1";
import MainPage from "../views/MainPage";
import UserLogin from "../views/UserLogin";
import Register from "../views/Register"
import GoodsDetails from "../views/GoodsDetails";
import UserHisOrder from "../views/UserHisOrder";


Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/login',
            name: 'Login',
            component: Login,
            meta: {
                keepAlive: false
            }
        },
        {
            path: '/userlogin',
            name: 'UserLogin',
            component: UserLogin,
            meta: {
                keepAlive: true
            }
        },
        {
            path: '/home',
            name: 'Home',
            component: Home,
            children:[
                {
                    path: '/userinfo',
                    name: '个人中心',
                    component: UserInfo
                }
            ],
            meta: {
                keepAlive: false
            }
        },
        {
            path:'/',
            redirect:'/mainpage'
        },
        {
            path: '/mainpage',
            name: 'MainPage',
            component: MainPage,
            meta: {
                keepAlive: true
            }
        },
        {
            path: '/userinfo1',
            name: '买家个人中心',
            component: UserInfo1,
            meta: {
                keepAlive: true
            }
        },
        {
            path: '/register',
            name: 'Register',
            component: Register,
            meta: {
                keepAlive: true
            }
        },
        {
            path: '/goodsdetails',
            name: 'GoodsDetails',
            component: GoodsDetails,
            meta: {
                keepAlive: true
            }
        },
        {
            path: '/userhisorder',
            name: 'UserHisOrder',
            component: UserHisOrder,
            meta: {
                keepAlive: true
            }
        },
    ]
})
